package com.dlc.shop.platform.task;

import com.linchuang.seneca.jky.bizdata.vend.vendcreate.core.VendCreateRequestBizData;
import com.linchuang.seneca.jky.bizdata.vend.vendcreate.core.VendCreateResponseBizData;
import com.linchuang.seneca.jky.exception.JkyException;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.dlc.shop.common.util.ExceptionUtils;
import com.dlc.shop.jky.common.service.ErpVendCreateV2Service;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@AllArgsConstructor
public class ShopProductJkySupplierTask {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());
     private final ErpVendCreateV2Service erpVendCreateV2Service;


    @XxlJob("ShopProductJkySupplierPriceTask")
    public void shopProSend() {
        try {
            erpVendCreateV2Service.GoodsSourceCreate(1,10);
        } catch (Exception e) {
            logger.info("吉客云数据同步失败："+ ExceptionUtils.getRunException(e));
        }
    }
    @XxlJob("ShopCompanyJkyTask")
    public void ShopCompany(){
        List<VendCreateResponseBizData> vendCreateResponseBizData = null;
        try {
            vendCreateResponseBizData = erpVendCreateV2Service.erpVendCreateV2(new VendCreateRequestBizData(), null);

        } catch (JkyException e) {
            logger.info("erp数据发送：失败"+ExceptionUtils.getRunException(e));
        }
    }
}
